﻿/*********************弘石项目三组************************
*  功能描述：合同管理业务逻辑层
*  作者：郇博驿
*  时间：2021-12-8
*  修改人：郇博驿
*  修改时间：2021-12-8
*********************弘石项目三组************************/
using Hong.IRepository;
using Hong.Model.Dto.PesponseDto.ResponseModel.ResultModel;
using Hong.Model.SysDomain.Model_ContractManagement;
using Hong.Model.SysDomain.Model_ContractManagement.StaModel;
using Hong.Repository.Repository.Repository_ContractManagement;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Hong.Business.Business_ContractManagement
{
    public class ContractBusiness
    {
        #region 构造器注入
        private readonly IContractRepository _contractRepository;
        public ContractBusiness(IContractRepository contractRepository)
        {
            _contractRepository=contractRepository;
        }
        #endregion


        #region 查询客户
        /// <summary>
        /// 查询客户
        /// </summary>
        /// <param name="name"></param>
        /// <param name="edCountryId2"></param>
        /// <param name="edCountryId3"></param>
        /// <param name="edTypeId"></param>
        /// <returns></returns>
        public List<ViewCustomer> GetCustomers(string name, string edCountry2Nmae, string edCountry3Nmae, string edTypeName)
        {
            return _contractRepository.GetCustomers(name, edCountry2Nmae, edCountry3Nmae, edTypeName);
        }
        #endregion

        #region 添加合同
        /// <summary>
        /// 添加合同
        /// </summary>
        /// <param name="contractInfo"></param>
        /// <returns></returns>
        public int AddContract(ContractInfo contractInfo)
        {
            return _contractRepository.AddContract(contractInfo);
        }
        #endregion

        #region 结构形式下拉框
        /// <summary>
        /// 结构形式下拉框
        /// </summary>
        /// <returns></returns>
        public List<StaStructuralstyleInfo> GetStaStru()
        {
            return _contractRepository.GetStaStru();
        }
        #endregion

        #region 建筑分类下拉框
        /// <summary>
        /// 建筑分类下拉框
        /// </summary>
        /// <returns></returns>
        public List<StaBuildingTypeInfo> GetBuild()
        {
            return _contractRepository.GetBuild();
        }
        #endregion

        #region 合同列表

        #region 合同查询页
        /// <summary>
        /// 合同查询页
        /// </summary>
        /// <param name="pageindex">当前页</param>
        /// <param name="pagesize">页大小</param>
        /// <param name="contractShowCondition">条件类</param>
        /// <returns></returns>
        public async Task<PageResponse<ViewContractInfo>> GetContractInfos(int pageindex, int pagesize, ContractShowCondition contractShowCondition)
        {
               return await _contractRepository.GetContractInfos(  pageindex,  pagesize, contractShowCondition);
        }
        #endregion
        #region 合同反填
        public ContractInfo GetContractInfosById(string id)
        {
            return _contractRepository.GetContractInfosById(id);
        }
        #endregion

        #region 合同修改
        /// <summary>
        /// 合同修改
        /// </summary>
        /// <param name="contractInfo"></param>
        /// <returns></returns>
        public int UpContractInfos(ContractInfo contractInfo)
        {
            return _contractRepository.UpContractInfos(contractInfo);
        }

        #endregion
        #region 合同删除
        /// <summary>
        /// 合同删除
        /// </summary>
        /// <param name="contractInfo"></param>
        /// <returns></returns>
        public int DelContractInfos(string id)
        {
            return (_contractRepository.DelContractInfos(id));
        }

        #endregion

        #region 合同收费列表
        /// <summary>
        /// 合同收费列表
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public List<ViewContracratetInfo> GetContractLists(string id)
        {
            return _contractRepository.GetContractLists(id);
        }
        #endregion

        #region 合同收费
        /// <summary>
        /// 合同收费
        /// <param name="contractrateInfo"></param>
        /// <returns></returns>
        public int AddContractrateInfo(ContractrateInfo contractrateInfo)
        {
            return _contractRepository.AddContractrateInfo(contractrateInfo);
        }
        #endregion

        #region 收费修改
        /// <summary>
        /// 收费修改
        /// </summary>
        /// <param name="contractrateInfo"></param>
        /// <returns></returns>
        public int UpContractrateInfo(ContractrateInfo contractrateInfo)
        {
            return _contractRepository.UpContractrateInfo(contractrateInfo);
        }

        #endregion

        #region 收费删除
        /// <summary>
        /// 收费删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public int DelContractrateInfo(string id)
        {
            return _contractRepository.DelContractrateInfo(id);
        }
        #endregion

        #region 收费统计

        #region 总额

        #endregion
        #region 月份
        public List<Showmounth> Getmounth()
        {
            return _contractRepository.Getmounth();
        }
        #endregion
        #region 季度
        public List<Showquarter> Getquarter()
        {
            return _contractRepository.Getquarter();
        }
        #endregion
        #region 合同类型
        public List<ShowcontractType> GetcontractType()
        {
            return _contractRepository.GetcontractType();
        }
        #endregion

        #endregion

        #endregion
    }
}
